﻿namespace Web.Control.Member.Teach
{
    using System;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Text.RegularExpressions;
    using Lx.Web.Common.UI;
    using Lx.Web.Common.ControlsUI;
    using System.Collections;

    using BLF.WWW_User.Teach;
    using Model.WWW_User.Teach;
using Model.WWW_User.User;

    public class Tpstep2 : BaseControl
    {
        protected ArrayList arrlist;
        protected string os = "";
        protected string memberno = "";
        protected UserSummaryInfoModel usm = new UserSummaryInfoModel();
        protected Lx.Web.Common.UI.DatePanel BOD;
        protected override void OnLoad(EventArgs e)
        {
            if (HttpContext.Current.User.Identity.Name == "")
            {
                Page.Response.Redirect(LoginHost + "/User/login.htm?ReturnUrl=" + Page.Request.Url.AbsoluteUri);
            }
            memberno = HttpContext.Current.User.Identity.Name;
            arrlist = Teach.GetTeachPro(memberno);

            os = arrlist[0].ToString();
            usm = arrlist[1] as UserSummaryInfoModel;
            switch (os)
            {
                case "-1": Response.End();
                    break;
                case "0": Page.Response.Redirect(LoginHost + "/" + (Page.Request.Url.AbsoluteUri.ToLower().IndexOf("invite_teach") >-1 ? "invite_teach" : "Teach") + "/Tpstep1.htm");
                    break;
                case "1": 
                    break;
                case "2": Page.Response.Redirect(LoginHost + "/" + (Page.Request.Url.AbsoluteUri.ToLower().IndexOf("invite_teach") >-1 ? "invite_teach" : "Teach") + "/Tpstep3.htm");
                    break;
                default: Page.Response.Redirect(LoginHost + "/" + (Page.Request.Url.AbsoluteUri.ToLower().IndexOf("invite_teach") >-1 ? "invite_teach" : "Teach") + "/Tpstep4.htm");
                    break;
            }
            if (BOD != null && usm.BOD != DateTime.Parse("1900-1-1"))
            {

                BOD.Text = usm.BOD.ToString("yyyy-MM-dd");
            }
            
             
        }
    }
}
